/*
 Navicat Premium Data Transfer

 Source Server         : dev_1
 Source Server Type    : MariaDB
 Target Server Type    : MariaDB
 File Encoding         : 65001

 Date: 19/05/2025 11:37:48
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    `password` TEXT NOT NULL,
    `roleList` TEXT,
    `currentRole` INT,
    `createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO `users` (`id`, `name`, `password`, `roleList`, `currentRole`, `createdAt`) VALUES (1, 'admin', '123456#', '[1,3]', 1, '2024-05-19 11:37:48');
INSERT INTO `users` (`id`, `name`, `password`, `roleList`, `currentRole`, `createdAt`) VALUES (4, 'ceshi', '123', '[3]', 3, '2024-05-19 11:37:48');
COMMIT;

-- ----------------------------
-- Table structure for roles
-- ----------------------------
DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    `status` INT NOT NULL DEFAULT 1,
    `menuList` TEXT,
    `createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createUser` INT,
    CONSTRAINT `roles_createUser_fkey` FOREIGN KEY (`createUser`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of roles
-- ----------------------------
BEGIN;
INSERT INTO `roles` (`id`, `name`, `status`, `menuList`, `createdAt`, `createUser`) VALUES (1, '超级管理员', 1, '[2,3,5,7]', '2024-05-19 11:37:48', 1);
INSERT INTO `roles` (`id`, `name`, `status`, `menuList`, `createdAt`, `createUser`) VALUES (3, '开发人员', 0, '[7,6,4,5]', '2024-05-19 11:37:48', NULL);
COMMIT;

-- ----------------------------
-- Table structure for OnlineLogs
-- ----------------------------
DROP TABLE IF EXISTS `OnlineLogs`;
CREATE TABLE `OnlineLogs` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `appName` VARCHAR(255) NOT NULL,
    `remark` TEXT NOT NULL,
    `user` VARCHAR(255) NOT NULL,
    `branch` VARCHAR(255) NOT NULL,
    `time` VARCHAR(255) NOT NULL,
    `fileName` VARCHAR(255) NOT NULL,
    `servicePath` TEXT NOT NULL,
    `version` TEXT,
    `fileSize` INT NOT NULL,
    `cliConfig` TEXT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of OnlineLogs
-- ----------------------------
BEGIN;
INSERT INTO `OnlineLogs` (`id`, `appName`, `remark`, `user`, `branch`, `time`, `fileName`, `servicePath`, `version`, `fileSize`, `cliConfig`) VALUES (27, '报表系统', '测试上线', 'xuyifei', 'master', '2024-12-05 06:30:23', '', '/opt/www/report_system', NULL, 4368492, '{\"appName\":\"报表系统\",\"reqUrl\":\"https://file_upload.workyd.com/api\",\"localPath\":\"./report_system\",\"servicePath\":\"/opt/www/report_system\",\"build\":\"build\",\"needBuild\":1,\"saveZip\":false,\"clearExclude\":\"*\",\"isLog\":true,\"username\":\"admin\",\"password\":\"123456#\",\"remark\":\"测试上线\",\"branch\":\"master\",\"user\":\"xuyifei\"}');
COMMIT;

-- ----------------------------
-- Table structure for menus
-- ----------------------------
DROP TABLE IF EXISTS `menus`;
CREATE TABLE `menus` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    `icon` VARCHAR(255),
    `parentId` INT,
    `sort` INT,
    `component` VARCHAR(255),
    `redirect` VARCHAR(255),
    `others` TEXT,
    `path` VARCHAR(255) NOT NULL,
    `status` INT NOT NULL DEFAULT 1,
    `createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of menus
-- ----------------------------
BEGIN;
INSERT INTO `menus` (`id`, `name`, `icon`, `parentId`, `sort`, `component`, `redirect`, `others`, `path`, `status`, `createdAt`) VALUES (1, '系统管理', NULL, NULL, NULL, NULL, NULL, NULL, '/admin/system', 1, '2024-05-19 11:37:48');
INSERT INTO `menus` (`id`, `name`, `icon`, `parentId`, `sort`, `component`, `redirect`, `others`, `path`, `status`, `createdAt`) VALUES (2, '角色管理', NULL, 1, NULL, NULL, NULL, NULL, '/role', 1, '2024-05-19 11:37:48');
INSERT INTO `menus` (`id`, `name`, `icon`, `parentId`, `sort`, `component`, `redirect`, `others`, `path`, `status`, `createdAt`) VALUES (3, '菜单管理', NULL, 1, NULL, NULL, NULL, NULL, '/menu', 1, '2024-05-19 11:37:48');
INSERT INTO `menus` (`id`, `name`, `icon`, `parentId`, `sort`, `component`, `redirect`, `others`, `path`, `status`, `createdAt`) VALUES (4, '用户管理', 'UserOutlined', NULL, NULL, NULL, NULL, NULL, '/admin/users', 1, '2024-05-19 11:37:48');
INSERT INTO `menus` (`id`, `name`, `icon`, `parentId`, `sort`, `component`, `redirect`, `others`, `path`, `status`, `createdAt`) VALUES (5, '用户列表', 'UsergroupAddOutlined', 4, NULL, NULL, NULL, NULL, '/user', 1, '2024-05-19 11:37:48');
INSERT INTO `menus` (`id`, `name`, `icon`, `parentId`, `sort`, `component`, `redirect`, `others`, `path`, `status`, `createdAt`) VALUES (6, '日志管理', 'AreaChartOutlined', NULL, NULL, NULL, NULL, NULL, '/admin/tools', 1, '2024-05-19 11:37:48');
INSERT INTO `menus` (`id`, `name`, `icon`, `parentId`, `sort`, `component`, `redirect`, `others`, `path`, `status`, `createdAt`) VALUES (7, '上线日志', 'ApartmentOutlined', 6, NULL, NULL, NULL, NULL, '/line_log', 1, '2024-05-19 11:37:48');
COMMIT;

-- ----------------------------
-- Indexes structure for table users
-- ----------------------------
CREATE UNIQUE INDEX `users_name_key` ON `users` (`name`);

-- ----------------------------
-- Indexes structure for table roles
-- ----------------------------
CREATE UNIQUE INDEX `roles_name_key` ON `roles` (`name`);

-- ----------------------------
-- Indexes structure for table menus
-- ----------------------------
CREATE UNIQUE INDEX `menus_name_key` ON `menus` (`name`);

SET FOREIGN_KEY_CHECKS = 1;
